<?php

class NewsController extends Controller
{
	public function actionDetail()
	{
		$id = isset($_GET['id']) ? intval($_GET['id']) : null;
		
		if (!empty($id)) {
			$news = News::model()->findByPk($id);
			$others = News::model()->searchOther($id);
		}
		
		$this->render('detail', array(
			'news' => $news,
			'others' => $others
		));
	}

}
